package co.beto.commons
{
	import co.beto.events.CollabornTextEvent;
	
	import mx.controls.Label;
	
	public class TextFieldCollaBorn extends Label
	{
		/**
		 * Creates the bitmap if it doesn't exist (or recreates it if the
		 * text changes). And sets the rotation on the bitmap. Bitmap
		 * has to be created on updateDisplay list otherwise the label 
		 * isn't created and there's nothing to create a bitmap of.
		 */
		public var _wc:Number;
		public var _hc:Number;
		private var _updateText : Boolean = true;
		
		
		override protected function updateDisplayList(unscaledWidth:Number, 
			unscaledHeight:Number):void
		{
			try {
				super.updateDisplayList(unscaledWidth, unscaledHeight);
				 _wc = width;
				 _hc = height;
				 if (_updateText) {
				 	_updateText = false;
					
					var collabornTextEvent:CollabornTextEvent = new CollabornTextEvent(CollabornTextEvent.EVENT_CHANGE_TEXT);
            		this.dispatchEvent(collabornTextEvent);
    			} 
    			

			} catch (e:Error) {
				trace("create not just completed");
			}
		}
	}
}